/*
 * @Author: zhoujinlong 765637726@qq.com
 * @Date: 2024-02-26 15:26:51
 * @LastEditors: zhoujinlong 765637726@qq.com
 * @LastEditTime: 2024-03-19 11:01:50
 * @FilePath: \pingxi\src\tools\time.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 * @description: 时间格式化 2022-12-12 10:10:00
 * @param {number} t 时间戳
 * @return {*}
 */
function time_YY_DD_MM_HH_MI_SS(t:number|string) {
  var dt = new Date(t);
  var y = dt.getFullYear();
  var m = dt.getMonth() + 1;
  var d = dt.getDate();
  var h = dt.getHours();
  var mi = dt.getMinutes();
  var s = dt.getSeconds();
  var ri = dt.getDay();

  s = s < 10 ? "0" + s : s;
  mi = mi < 10 ? "0" + mi : mi;
  h = h < 10 ? "0" + h : h;
  return `${y}-${m}-${d} ${h}:${mi}:${s}`;
}

export { time_YY_DD_MM_HH_MI_SS };
 